<?php
namespace app\staff\model;
use think\Db;
use app\common\model\Common;
class Category extends Common
{
	protected $table = 'mps_category';

	/**
	 * 获取属性
	 */
	public function getAttributeList($category_id)
	{
		$data['brand_name'] = $this->getAttribute($category_id, 0);
		$data['memory_name'] = $this->getAttribute($category_id, 1);
		$data['attribute_name'] = $this->getAttribute($category_id, 2);
		$data['colour_name'] = $this->getAttribute($category_id, 3);
		return $data;
	}

	/***************************** 私有 ******************************/
	/**
	 * 获取属性
	 */
	private function getAttribute($category_id, $type)
	{
		return Db::name('attribute')->where('category_id',$category_id)->where('type',$type)->select();
	}
}